package org.mclll.xwangplugin.town.database.mapper.manage;

import com.google.common.collect.Lists;
import org.apache.ibatis.session.SqlSession;
import org.mclll.xwangplugin.datasource.MybatisConfig;
import org.mclll.xwangplugin.town.database.domain.TownTaxRecordDO;
import org.mclll.xwangplugin.town.database.mapper.TownTaxRecordMapper;

import java.util.List;

/**
 * @author llB
 * @date 2024-06-10 21:24
 * @description todo
 */
public class TownTaxRecordManage {

    public static List<TownTaxRecordDO> selectList(TownTaxRecordDO param) {
        List<TownTaxRecordDO> ret = Lists.newArrayList();
        try(SqlSession sqlSession = MybatisConfig.SQL_SESSION_FACTORY.openSession()) {
            TownTaxRecordMapper mapper = sqlSession.getMapper(TownTaxRecordMapper.class);
            ret = mapper.selectList(param);
        }
        return ret;
    }

    public static void insert(TownTaxRecordDO param) {
        try(SqlSession sqlSession = MybatisConfig.SQL_SESSION_FACTORY.openSession()) {
            TownTaxRecordMapper mapper = sqlSession.getMapper(TownTaxRecordMapper.class);
            mapper.insert(param);
            sqlSession.commit();
        }
    }
}
